package cn.glc.daily.life.web.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author simon
 * @date 2020/9/23 14:32
 * @copyright:
 * @modifier
 * @motto a no talent, people who have to study hard
 */
@Slf4j
@RestController
public class ExceptionController {

    @RequestMapping(value = "/error/throw")
    public void error(HttpServletRequest request, HttpServletResponse response) throws Exception {
        throw ((Exception) request.getAttribute("exceptionErrorMsg"));
    }
}
